/*
 * @Author: c
 * @Date: 2024-01-08 22:13:45
 * @LastEditTime: 2024-03-04 15:21:37
 * @LastEditors: c
 * @Description: 
 * @FilePath: \music-web-backend\src\core\music\banner\dto\create-banner.dto.ts
 * https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Transform } from "class-transformer";
import { IsDate, IsEnum, IsNumber, IsOptional } from "class-validator";
import { BannerType } from "src/common/enums/banner.enum";
export class BannerForm {

    pic: string;
    title: string;
    @IsEnum(BannerType, { message: "轮播图资源的类型不正确" })
    jumpType: BannerType;
    scenesName: string;
    scenesCode: string;
    scenes: string;
    
    @IsOptional()
    @IsNumber({ allowInfinity: false, allowNaN: false }, { message: "轮播图资源的id不正确" })
    // @IsUUID('all', { message: "轮播图资源的id不正确" })
    jumpLinkOutput: number;

    @IsNumber({ allowInfinity: false, allowNaN: false }, { message: "排序必须是数字" })
    sort: number;
    @Transform(v => new Date(v))
    @IsDate({ message: "轮播图开始日期类型不正确" })
    showStartDate: Date;
    @Transform(v => new Date(v))
    @IsDate({ message: "轮播图结束日期类型不正确" })
    showEndDate: Date;
}
